package com.swgk.core.recyclerview.decoration;

import android.graphics.Rect;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;

/**
 * Description:
 * Author zhengkewen
 * Time 2017/12/13
 */
public class RecyclerViewItemDecoration extends RecyclerView.ItemDecoration {
    private float space = 0;

    public RecyclerViewItemDecoration(float space) {
        this.space = space;
    }

    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
        outRect.top = (int) space;
        outRect.left = (int) (space / 2);
        outRect.right = (int) (space / 2);
    }
}
